<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" import="java.util.*"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
//response.sendRedirect("common/login");
%>
<c:set var="path" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>DictionaryList</title>
			<script type="text/javascript" src="${path }/resource/js/jquery-1.8.3.min.js"></script>
			<script type="text/javascript" src="${path }/resource/js/mytools.js"></script>
			<script type="text/javascript" src="${path }/resource/layer/layer.js"></script>
			<script type="text/javascript" src="${path }/resource/layui/layui.js" ></script>
			<link rel="stylesheet" href="${path }/resource/layui/css/layui.css" />
	</head>
	<body>
	
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>表格风格表单</legend>
</fieldset>

<form class="layui-form layui-form-pane" id="searchFrom">
<div class="layui-form-item" >
  
    <div class="layui-inline">
     <label class="layui-form-label">dicType:</label>
     <div class="layui-input-inline">
		<input type="text"  class="layui-input" autocomplete="off" name="dicType" />
	 </div>
  </div>	
  
    <div class="layui-inline">
     <label class="layui-form-label">dicKey:</label>
     <div class="layui-input-inline">
		<input type="text"  class="layui-input" autocomplete="off" name="dicKey" />
	 </div>
  </div>	
  
    <div class="layui-inline">
     <label class="layui-form-label">dicValue:</label>
     <div class="layui-input-inline">
		<input type="text"  class="layui-input" autocomplete="off" name="dicValue" />
	 </div>
  </div>
  
  <div class="layui-inline">
  <div class="layui-input-block">
      <input type="button" class="layui-btn layui-btn-small" onclick="mjs.search()" value='搜索'>
      <input type="reset" class="layui-btn layui-btn-primary layui-btn-small" value='重置'>
       <input type="button" value="新增" onclick="mjs.editFrom()" class="layui-btn layui-btn-small"/>
     <!--  <input type="button" value="批量删除" onclick="" class="layui-btn layui-btn-danger layui-btn-small"/> -->
    </div>	
    </div>	
</div>

<div class="layui-form-item" >
    
</div>

</form>
	
	<div id="tablediv">
	<table id="table1" class="layui-table">
	<thead id="thead">
		<tr>
		<th data-name = "id" data-format="buildOperation">操作</th>  
		<th data-name = "dicType">dicType</th>  
		<th data-name = "dicKey">dicKey</th>  
		<th data-name = "dicValue">dicValue</th>  
		</tr>
	</thead>
	</table>
	</div>
	<br>
	<script>
	var mjs =	mytooljs.initTable({  
		idSelecter:"#table1",
		sendurl:"${path}/common/Dictionary/showList" , //求数据的地址
		pagesize:5,//分页大小
		delUrl:"${path}/common/Dictionary/del",//删除数据地址
		editUrl:"${path}/common/Dictionary/editForm" //打开编辑或新增页面地址
		});
	
	//操作
	function buildOperation(id,index) {
			var html = "<div class='layui-btn-group'>";
			html+=
				 " <button class='layui-btn layui-btn-small layui-btn-primary' onclick='mjs.editFrom("+ id + ")' >"
				+" <i class='layui-icon'>&#xe642;</i>"
				+" </button>";
			html+= 
				 " <button class='layui-btn layui-btn-small layui-btn-primary' onclick='mjs.delRec("+ id + ")' >"
				+" <i class='layui-icon'>&#xe640;</i>"
				+" </button>"
			    +"</div>";
			return html;
		} 
	</script>
	</body>
</html>
